public class of22 {
    public static void main(String[] args) {
        
    }
    public ListNode getKthFromEnd(ListNode head, int k) {
        ListNode n1=head;
        ListNode n2 =head;
        while(k-->0){
            n2=n2.next;
        }
        while(n2!=null){
            n1=n2.next;
            n2= n2.next;
        }
        return n1;
    }
}
